package com.szzg10.thinking.chapter18;

import java.io.BufferedInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;

public class BinaryFile {

	public static byte[] read(File file) throws IOException {
		FileInputStream fileInputStream = new FileInputStream(file);
		BufferedInputStream in = new BufferedInputStream(fileInputStream);
		
		byte[] bytes = new byte[in.available()];
		in.read(bytes);
		in.close();
		
		return bytes;
	}
}
